package com.zsx.demo;

import java.util.Scanner;

/**
 * 〈3〉
 *
 * @author zhangsixian
 * @create 2021/6/11
 * @since 1.0.0
 */
public class Test3 {
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int b = 0;
        while (s.hasNext()) {
            int n = s.nextInt();
            if (n == 0) {
                return;
            }
            for (int i = 0; i < n; i++) {
                int a = s.nextInt();
                b = b + a;
            }
            System.out.println(b);
            b = 0;
        }
    }
}
